package com.wb3.meta.common.constant;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;

/**
 * 通用常量类
 */
public class CommonConstant {

    //redisKey
    public static final String blockNum = "block_number_"; //当前最新的block_number
    public static final String awardConfig = "award:awardConfig"; //活动总配置
    public static final String awardPercent = "award:awardPercent"; //活动每日权重配置只存当前天的
    public static final String awardLock = "award:awardLock"; //抽奖分布式锁
    public static final String awardPercentHour = "award:award_percent_hour_"; //活动每小时当前抽出数量

    public static final String degenLock = "degen:degenLock"; //裂变分布式锁

    public static final String twitterLimitNum = "twitter:limitNum"; //推特15分钟25次请求限制

    public static final Short awardFillStateInit = 0; //补签 转账从链上同步回来的初始状态
    public static final Short awardFillStateUse = 1; //补签 状态 1 为已使用补签

    public static final Integer awardType_U = 0; //奖品类型 U

    public static final Integer awardType_Tks = 3; //奖品类型 谢谢惠顾

    public static final Short awardActivityType = 1; //第二期活动兑换类型  第一期使用默认值0

    public static final Short awardRecordState_0 = 0; //未兑换
    public static final Integer awardRecordState_1 = 1; //发起兑换 审核中

    //任务跳转链接
    public static final String twitterFollow = "https://twitter.com/intent/follow?screen_name="; //推特关注
    public static final String twitterRetweet = "https://twitter.com/intent/retweet?tweet_id="; //推特转发
    public static final String twitterLike = "https://twitter.com/intent/like?tweet_id="; //点赞推特

    //任务标题
    public static final String twitterBindTitle = "Bind Twitter"; //推特绑定
    public static final String twitterFollowTitle = "Follow @%s on Twitter"; //推特关注
    public static final String twitterRetweetTitle = "Retweet @%s on Twitter"; //推特转发
    public static final String twitterLikeTitle = "Like a Tweet by @%s on Twitter"; //点赞推特

    public static final String twitterQuantity = "Number of followers on Twitter"; //推特粉丝数量达到X

    public static final String discordJoinTitle = "Have the FAM member role in %s Discord server"; //点赞推特

    public static final String telegramJoinTitle = "Telegram"; //加入 Telegram


    //抽奖返回错误提示信息
    public static final String award_error_lottery_not_started = "Coming Soon"; //抽奖活动日期未开启
    public static final String award_error_not_time_for_the_lottery_yet = "Coming Soon .";//第一天时候 玩家点击了第二天的抽奖
    public static final String award_error_lottery_has_already_been_drawn_today = "You have fliped your chapter today, please try again tomorrow"; //当天重复抽奖提示
    public static final String award_error_transfer_has_not_arrived= "On-chain transaction not found. Please make sure you have purchased the missed flips or try again later"; //补签之前的抽奖时没找到链上转账记录
    public static final String award_error_Not_eligible_for_the_lottery = "You need to complete all previous flips to be qualified for the Ultimate Flip";//最后的大奖要求，总之需要提示玩家去补签
    public static final String award_error_too_many_people_in_the_current_draw= "Server busy. Please try again later"; //并发抽奖时防止奖品溢出的一种处理，提示玩家稍后再抽即可
    public static final String award_error_system_config_error = "System config error"; //抽奖活动系统配置异常

    //协议类型区分 721
    public static final String tokenstd_721 = "ERC721";
    public static final String tokenstd_20 = "ERC20";
    public static final String tokenstd_1155 = "ERC1155";
    public static final String tokenstd_721_lock = "ERC721_lock";
    public static final String tokenstd_721_unlock = "ERC721_unlock";

    //验证条件类型
    public static final int conditionType_1 = 1; //链接discord
    public static final int conditionType_2 = 2; //连接twitter
    public static final int conditionType_3 = 3; //加入Discord某个服务器社区
    public static final int conditionType_4 = 4; //再Discord某个服务器社区有角色
    public static final int conditionType_5 = 5; //关注了某twitter
    public static final int conditionType_6 = 6; //转发了某twitter
    public static final int conditionType_7 = 7; //点赞了某twitter
    public static final int conditionType_8 = 8; //设置了twitter头像
    public static final int conditionType_9 = 9; //设置了twitter简介
    public static final int conditionType_10 = 10; //twitter粉丝超过X
    public static final int conditionType_11 = 11; //发过推特


    public static final String activityLock = "activity:activityLock"; //先到先得活动报名分布式锁



    public static final String errorTag = "_error_"; //回调厂商订阅 出现错误 分隔符


    //货币转换汇率查询
    // https://pro.coinmarketcap.com/account   KEY
    public static final String changeApiKey = "4b13c265-928f-439d-8f5d-94cd06cc1f19";
    //货币转换地址
    public static final String changeUri = "https://pro-api.coinmarketcap.com/v2/tools/price-conversion";


    //布尔值 0是FALSE 1是TRUE
    public static final BigDecimal BOOLEAN_BIGDECIMAL_NO = new BigDecimal(0);
    public static final BigDecimal BOOLEAN_BIGDECIMAL_YES = new BigDecimal(1);

    //日历事件title Type
    public static final String eventType_join = "ActivityJoin"; //活动加入类型
    public static final String eventType_award = "ActivityAward"; //活动获奖类型

    //日历事件title
    public static final String eventTitle_join = "活动%s报名成功"; //活动%s报名成功
    public static final String eventTitle_award = "恭喜您报名的%s活动中奖了，我们会给您发放奖品"; //恭喜您报名的%s活动中奖了，我们会给您发放奖品

    public static final Map<String, List<String>> ES_SEARCH_IGNORE_FIELD = new HashMap<String, List<String>>(1, 1) {{
       List<String> list = new ArrayList<>(1);
       list.add("language");
       put("user", list);
    }};
}
